perm filename EDMAN.SRS[UP,DOC] blob
sn#011065 filedate 1972-11-10 generic text, type T, neo UTF8
COMMENT ⊗ VALID 00020 PAGES
RECORD PAGE DESCRIPTION
00001 00001 PAGE DIRECTORY
00005 00002 ED -- A NEW DISPLAY EDITOR
00006 00003 BASICS, AND OTHER DOCUMENTS
00007 00004 WINNING FEATURES AND AN OVERVIEW
00011 00005 PHILOSOPHY
00015 00006 NOTATION
00016 00007 ABOUT THE SCREEN, WINDOWS, AND EDITING MODES
00019 00008 DEBUGGING COMMANDS
00020 00009 SAFETY and EXIT COMMANDS
00022 00010 NUMBER COMMANDS
00023 00011 STACK COMMANDS
00025 00012 MOVING COMMANDS
00028 00013 ABOUT POINTERS AND STRINGS
00030 00014 POINTER COMMANDS
00032 00015 STRING COMMANDS
00035 00016 EDIT COMMANDS
00036 00017 DISPLAY COMMANDS
00039 00018 ABOUT FILES
00041 00019 FILE COMMANDS
00044 00020 HOW TO EDIT A FILE--hints and kinks
00045 ENDMK
⊗;
ED -- A NEW DISPLAY EDITOR
-- Steve Savitzky
This document is a preliminary manual for a preliminary version of a
new, display-oriented text editor. ED is easy to use (although a
little confusing at first), and is believed to be the only editor
around capable of operating on several files at once.
The present version of ED is somewhat slow, but pretty reliable.
This will improve soon. Until then, ED should be considered experimental
but recommended.
Comments about ED or about this manual will be appreciated.
BASICS, AND OTHER DOCUMENTS
TO RUN ED, TYPE "R ED" TO THE MONITOR.
When ED is started, it will put on the screen a pagefull of information,
contained in the file EDHELP.SRS[S,SRS]. This page will mention the
other documents, namely the rest of EDHELP, which describes the vast
collection of commands in less detail and much less space, and
TUTOR.SRS[S,SRS], which is intended to be perused through ED, and will
attempt to teach you how to use it.
I you have not already done so, it might be a good idea for you to run
ED, and try the TUTOR course.
WINNING FEATURES AND AN OVERVIEW.
ED is a new, display-oriented text editor. Why? After all, there are already
two editors floating around: SOS and TV (three if you count TECO). There are,
however, some winning features in ED.
First of all, ED is said to be faster than TV. It certainly is for some things.
Soon, I hope, it will be even faster. So what? SOS is faster still.
Second, ED is the only editor around capable of editing in more than one file at
once. If you want to outright transfer stuff from one file to another, or even
copy it when you don't remember where you put it, and have to go searching through
the file for it, it beats using SOS and copying down line numbers.
Third, ED has such things as MACROS, SEARCHING, and SUBSTITUTION.
Fourth, ED is intended (it isn't there yet) to be compatible with all other
editors, and processors and their file formats. At the moment, it uses a varient
on TV's directory system (you have to make descriptions yourself). Eventually,
there will also be a non-directory mode, and even SOS line-numbers. You will
also be able to look at and replace in the file any character at all, including
delete codes, altmodes, naked linefeeds, and so forth. (Not yet)
Fifth, Ed has (will have) two-dimensional capability making it useful for drawing
simple pictures, flowcharts, diagrams, and all the other things which you've
always wanted to stick into the comments of your programs but didn't have the
time to type in.
NOW THE OVERVIEW:
This file is intended as a more detailed description of ED than that found in
EDHELP.SRS, but not necessarily a more complete one. In particular, some of
the more amazing new commands may be omitted in the body of EDMAN for a while,
or be hard to find. That's what [EDHELP/3] is for--it is the main reference on
exactly what commands exist, and exactly what they do. EDMAN will (for now)
simply try to fill in the gaps in explanation--notation, terminology, what the
data structures are (at a user level), what they can do, and roughly how they
do it.
PHILOSOPHY:
ED is based on some important philosophical principles. One of these is that the
most winning kind of interface between a man and a computer is a display console
and a keyboard. The display is obvious. The keyboard may require some more
explanation--I don't believe in lightpens, mice, etc. too much because they make
you move back and forth between a cursor-moving device and a text-entering device.
On a keyboard with control bits, you have all the buttons and widgits you need.
Along with this goes the dedication to single-character commands. The characters
selected are intended to be mnemonic, but the restriction to single characters
occasionally gets in the way. There is an escape (actually several) into a more
verbose command language, for the less commonly used or more complex functions.
Another bit of philosophy is that one should not throw stuff away without giving
yourself a way to get it back in case you didn't really mean it. ED tries to keep
things around, mostly by putting it on the stack (about which more later), and
making you get rid of it explicitly. This should make it slightly more difficult
to zap yourself.
Ed is based on strings and pointers into them. A string can be thought of as a
linked list of characters, such that if a pointer is pointing at a particular
character, and more characters are inserted or deleted at some other place in the
string, the pointer is not disturbed. This is somewhat akin to the idea of
"sticky" line-numbers in SOS, and equally pervasive. Pointers are easily formed,
mostly via the α. command, and easily manipulated. Substrings can be designated
by pointing at their two endpoints.
The vehicle of all this magic is the STACK. This is the area displayed at the
top of the screen. New objects, such as pointers, strings, numbers, and so forth,
are pushed up from the bottom. Nothing is lost off the top--you simply can't see
it. Those commands which take strings or other things as arguments get them off
the stack. There is also a current number, which is used by most commands, and
which is entered in an obvious manner.
NOTATION:
α <ctrl> key--thus α∨ is the command you used to get here from page 2
β <meta> key
ε <ctrl & meta> keys together
αε α or ε
n the current numerical argument: see page 8. If missing, assumed to be 1
N the current numerical argument, assumed to be 0 if omitted
Sn the n-th object on the stack. if n=0 or doosn't exist, 1 is assumed
SN like Sn but if n=0, the top of the stack is pushed or popped
¬ in front of a description means not yet implemented
ABOUT THE SCREEN, WINDOWS, AND EDITING MODES
The display screen is divided into areas called Windows. Initially there
are two; you may have more if you wish. Each window consists of a header
line, some text, and a cursor. Window 1 always displays the stack; the
others display pieces of files or internal strings.
The Header line contains the window number and the name of the entity shown.
If this entity is a file, there is also a page number and perhaps a /R if it
is in read-only mode. Also, the window may be Protected, indicated by a *
after the window number, which means that the window will be ignored by such
commands as ε<form>, which look for a window to clobber.
The cursor may be either a _ → or ↔.
_ indicates an inactive window
→ indicates the (unique) active window, in whole-LINE mode
↔ indicates the active window in INTRA-line mode.
INTRA-line mode is entered by typing an intra-line edit command, and left by
either ε<tab> or a command which moves to another string, such as α∨ or α*.
≤ or ≥ at the extreme left of a line indicate that more lines exist
before the first line or after the last line of the screen, respectively.
(These are intended to be mnemonic of the appropriate command for getting
to these lines, namely α≤ and α≥.)
A ], [, or | in the column just before the text of a line indicates that the
line has been clipped off to the right, left or both, respectively.
DEBUGGING AND ASSISTANCE COMMANDS
nα? display page n of this file
ε? generate a breakpoint--mainly used by debuggers
<alt> undo the effects of an inra-line edit.
¬α<alt> will undo the effects of the previous command
ε<alt> restores a munged-over page to its original (since last written)
state, leaving the old version as a string on the stack.
also a pretty good way to copy a page, I suppose.
SAFETY and EXIT COMMANDS
αW writes out the file you are now editing
εW writes out all files
αE writes out all files and exits to the monitor
αG writes out all files and exits to RPG
εE is like αE except it also saves the state of ED in EDSAVE.DMP on
your disk area. note that if you change a file before running
this dump, ED will probably get very confused
εG like εE except exit to RPG
<call> REENTER<cr> when done in command loop, sets up display without
losing information. Lets you move from DDD to III display, or
recover from "soft" system crashes.
Reenter is also a good way to recover from bugs, glitches and parity errors.
It will succeed unless a bug has left your internal data structure in a
really bad state.
<alt> see previous page
NUMBER COMMANDS
αε<digit> append to numerical argument n
αε∞ set n to a large positive number
α- start a negative number
α+ start a positive number
nα# push n (S←n)
nα↑ get number from stack (n←SN) (ie if n=0, stack is popped)
¬nαV scan Sn for number (Value)
¬εV scan characters after . for number
ABOUT THE STACK:
There is a stack. It is a push-down stack displayed with the top datum,
called S1, displayed at the top.
Several commands cause things to be pushed onto and popped off of the stack.
Sn means the nth thing from the top of the stack, with S1 being the top.
S or S0 means either: pop old S1 or push new S1, SN means the nth thing on
the stack with 0(push or pop) assumed if no numerical argument was given.
Nothing is lost off the bottom; only the last 3 items pushed are displayed.
This number can be changed by the NεY command.
nα↑ pop (←S) n times
nα↓ push Sn (S←Sn)
nα↔ swap (S↔Sn) (thus α↔ swaps first two things on stack)
Some commands, such as α←, require two arguments. In such cases, the first
argument is POPPED off the stack, then SN is used as the second argument,
then the result (if any) is PUSHED onto the stack.
MOVING COMMANDS
in this group, negative n does the inverse thing, if meaningful.
nα<blank> space forward n characters. default is 1
n<return> go forward n lines. end up at beginning of line
nα> move forward n lines. end up in same column as you started in
nα< move backward n lines. end up in same column as you started in
nε> move forward n glitches (4 lines/glitch)
nε< move backward n glitches
α≥ move forward half a windows-length
α≤ move back half a window
ε≥ move forward a full window, -1 line so old . stays in window
ε≥ move back a full window
nαε∨ move forward n pages. write out current page. append at most 1 page
nα∧ move back n pages
nαP move to page n
nεP same as nαP provided n not zero
αP write out current page; no movement
εP move to line in directory corresponding to this page.
α<tab> move to end of line
if given at the end of a line in a page directory, goes to that page
ε<tab> move to beginning of line and leave intra-line mode
nαS<c> move to nth occurrance of character c after . (in current line only)
ABOUT POINTERS AND STRINGS
A Pointer refers to a particular place in a particular string. The cursor
which indicates the current line and character is a pointer. A pointer is
located between two characters--in intra-line mode, it is before the
underlined character, and in in whole-line mode, before the first character
in the line.
Pointers may be put on the stack, in which case they are represented as an
integral sign () in the midst of a line. The representation of a pointer
on the stack is, in fact, as a range, containing the whole line.
A Range is a pair of pointers, and designates the string between them.
a simple pointer is itself also a range, namely the line which contains it.
A String is a piece of text such as a page, internal string, or the text in
a range.
A range must be entirely inside one string, and thus may not extend across
page boundaries (yet).
POINTER COMMANDS
α. push a pointer to current position (S←.)
nα* swap current position with nth thing on stack (Sn↔.)
if no current position (null window) and n=0, pop stack
if top of stack is a string and not a pointer, position is at start
nε* if you are in an empty screen, this is the same as α*.
otherwise, it is the same as αUnα*, ie it puts you in the next
window first.
ε. push whole string being edited, and pop to the previous window
on the window list (see SCREEN on /4)
nα∀ replace Sn by whole string containing pointer Sn. This string
will be at most a page long. (see FILE on /13)
nε: push pointers to the range between S and Sn. this results in a
pointer to a substring, otherwise known as a range
nα: like ε: but extended to line boundaries--this is the one you use
most of the time. Remember that if you want a range consisting of
only one line, α. will give you one without any further fuss.
STRING AND RANGE COMMANDS
nαC copy SN to before .
nαR remove range Sn from file and turn it into a separate string
nαT like αC but if SN is a range, its contents are made null.
equivalent to nα↓αRαC
α<form> form all characters up to the next activation character into
a string, and push that onto the stack. if the activation char.
is <cr>, include it in the string. if it is <alt>, ignore it.
otherwise, use it as the next command
ε<form> form a new window, and edit a temporary string in that window,
pushing the current window onto the window list.
thus, if you do ε<form>, make a string, and say ε., you will
end up in the same window you started from, with the new string
on top of the stack
NOTICE that αC copies a RANGE to a POINTER. In particular, this means that if
you change what the range is pointing to between the time you put it on the stack
and the time you copy it, you will not copy exactly what you saw in the file when
you put the range on the stack. It's just like a range in SOS. Also, if you
try to copy a range to a point inside itself, don't be too suprised if your core-
image starts growing alarmingly. Someday I'll check for that. Til then, a
<call>REENTER sequence will stop it.
EDIT COMMANDS
nαD delete n characters
nεD delete n lines
αI insert characters
β<c> insert character c
nαK<c> kill to nth occurrance of c
nεI insert n lines before . (if n=0, insert until a move command other
than <cr> is done)
DISPLAY COMMANDS
nαY set number of windows on the screen to n. if n=0, then add one
more window
nεY set number of lines in the window which displays the stack to n
αZ update the entire screen
εZ keep the screen from being updated
nαH "protect" window n, so that commands which use the next window
will skip over it. negative n will unprotect. 0 is current window
nαU use (ie edit the string displayed in) window n (0 is the next one)
nεU same as αU except it replaces the old window with a shiny new
(empty) one first.
α⊃ NXTW go to next window on list α⊂ PRVW go to prev. window
ε⊃ ANXTW add next window to screen ε⊂ APRVW add prev. window
ε∪ INXTW insert new next window α∩ IPRVW insert new prev. window
ε∪ IANXTW insert and add nnxt win. ε∩ IANXTW insert and add prev. window
["add" means add to screen; "insert" means insert on list]
if all this seems obscure, that's because it is. Pretty soon, all this will
become simpler, when I fix up the way in which windows are displayed. In
particular, vertical relationships on the screen will reflect ordering
relations on the window list. This is presently not the case--the windows on
the screen are displayed in the order in which you get around to asking for
them, causing no end of confusion.
ABOUT FILES
Internally, you edit Strings. Externally, there are Files.
Normally, files are divided into Pages, which you edit as
SEPARATE STRINGS. later there will be a way around this.
The thing which defines the correspondance between pages in your
file and strings in core is the Directory, which lives in Page 1.
If your file lacks a directory, you can get one by using TV: say
.TV <filename><cr> αE to the monitor.
All pages after page 1 begin on a record boundary with a form feed.
SOS line numbers are not presently handled.
The directory is not presently totally compatible with TV. in
particular, you are permitted to edit in your page directory, and
use any kind of headings you want. The directory is otherwise ok,
and is marked VALID. Later I may change this, since it makes it
easy to louse up your directory and get really badly screwed.
FILE COMMANDS
nαF replace Sn by the file named in Sn. the file is created if
need be; you will be told when this happens. /R following
the filename makes it readonly; /n gets you page n.
/C will create a new file with the given name
/W lets you write in a file on some other disk area
¬ #n gets you the n th line on the page; $n gets you the line with
¬ SOS line-number n.
if the page number is omitted you get page 1, the directory.
if the filename is omitted, you get the file you are currently
editing. Thus α<form>αF (ie F applied to the null string) works
like α.α∀ This is so that::::::::
¬ arbitrarily hairy search expressions can follow the filename!
(after I get them implemented)
εF this works like αF, except that the string scanned is the one
you are editing, at . This makes cross-references easy.
HOW TO EDIT A FILE--hints, kinks, and glitches
This is the magic sequence which finds a file and puts it in a window:
α<form>filename αFα* (think about it.)
The display code still gets screwed up at times--just say αZ and maybe α≤α≥ to
get what you want back where it should be.
If you have any trouble, send a note to Steve Savitzky (SRS).
If this seems incomprehensible (and it is), start editing TUTOR[S,SRS]/R, as
suggested on Page 2 of EDHELP.SRS, the page you are looking at when ED starts up.